#@layout()
#define script()
<script>

	function trash(id) {
		ajaxGet("#(CPATH)/admin/product/doTrash/" + id);
	}


	function draft(id) {
		ajaxGet("#(CPATH)/admin/product/doDraft/" + id);
	}

	function normal(id) {
		ajaxGet("#(CPATH)/admin/product/doNormal/" + id);
	}

	function del(id) {
		if (confirm('确定要删除该产品吗？删除后不可恢复')) {
			ajaxGet("#(CPATH)/admin/product/doDel/" + id);
		}
	}

</script>
<script src="../js/jquery.min.js"></script>
<script src="./js/index.js"></script>
#end

<style>
    #img-content {
		width: 900px;
		column-count: 3;
		column-gap: 20px;margin: auto
	}

	.image {
		display: inline-block;
		width: 300px;
		margin-bottom: 7px;
	}
</style>


#define content()

	<section class="content-header">
		<div class="container-fluid">
			<div class="row">
				<div class="col-sm-6">

					<div class="row mb-2">
						<div class="col-sm-12">
							<h1>
								网盘
							</h1>
						</div>
					</div>

					<div class="row">
						<div class="col-12" style="padding-top: 20px">
							<a href="#(CPATH)/admin/product/list">全部 (#(totalCount ??))</a> |
							<a href="?status=1">已发布 (#(normalCount ??))</a> |
							<a href="?status=2">草稿 (#(draftCount ?? 0))</a> |
							<a href="?status=3" style="color: #a00">垃圾箱 (#(trashCount ?? 0))</a>
						</div>
					</div>

				</div>
				<div class="col-sm-6 ">
					<div class=" float-sm-right" style="padding-top: 45px">
						<a href="./edit" type="button" class="btn btn-primary"><i class="fas fa-plus"></i>新建</a>
					</div>
				</div>

			</div>

		</div><!-- /.container-fluid -->
	</section>

	<section class="content">
		<div class="container-fluid">
				<div class="card card-outline card-primary">
					<div class="card-header with-border">
<!--						<form class=" admin-search-panel" action="" method="get">-->
<!--							<input type="hidden" name="status" value="#para('status')">-->
<!--							<div class="row">-->
<!--								<div class="form-group col-lg-2">-->
<!--										<input type="text" placeholder="标题" class="form-control" name="title" value="#para('title')">-->
<!--								</div>-->
<!--								<div class="form-group col-lg-2">-->
<!--										<select class="form-control" name="categoryId">-->
<!--											<option value="">全部分类</option>-->
<!--											#for(category : categories)-->
<!--											<option value="#(category.id ??)" #selectedIf(category.isCheck)>-->
<!--												#(category.layerString) #(category.title ??)-->
<!--											</option>-->
<!--											#end-->
<!--										</select>-->
<!--								</div>-->
<!--								<div class="form-group col-lg-2">-->
<!--										<button type="submit" class="btn btn-primary ">查询</button>-->
<!--										<button type="reset" class="btn btn-default">重置</button>-->
<!--								</div>-->
<!--							</div>-->
<!--							&lt;!&ndash; /.card-body &ndash;&gt;-->
<!--						</form>-->

					</div>
					<div id="img-content">
						#for(fileNode : page.list)
							<img class="image" width="300" src="#(fileNode.imgUrl)"></img>
						#end
					</div>
					<!-- /.card-header -->
<!--					<div class="card-body p-0">-->
<!--				-->
<!--						<table class="table table-striped">-->
<!--							<tbody>-->
<!--							<tr>-->
<!--								<th style="width: 350px">文件名</th>-->
<!--								<th style="width: 50px">大小</th>-->
<!--								<th style="width: 50px">修改时间</th>-->
<!--								<th style="width: 50px">是否文件夹</th>-->
<!--							</tr>-->

<!--							#for(fileNode : page.list)-->
<!--							<tr>-->

<!--								<td style="white-space:nowrap">-->
<!--									#if(fileNode.type == "folder")-->
<!--										<a href="/admin/nas/index?path=#(fileNode.fileName)">-->
<!--											#(fileNode.fileName ??)-->
<!--										</a>-->
<!--									#else-->
<!--										<a href="/admin/nas/showFile?path=#(fileNode.fileName)">-->
<!--											#(fileNode.fileName ??)-->
<!--										</a>-->
<!--									#end-->
<!--								</td>-->
<!--								<td style="white-space:nowrap">-->
<!--										#(fileNode.size ??)-->
<!--								</td>-->
<!--								-->
<!--								<td>-->
<!--									#date(fileNode.lastModified)-->
<!--								</td>-->
<!--								<td>#if(fileNode.type == "folder")-->
<!--										是-->
<!--									#else-->
<!--										否-->
<!--									#end-->
<!--								</td>-->
<!--							</tr>-->
<!--							#end-->
<!--							</tbody>-->
<!--						</table>-->
<!--					</div>-->
					<!-- /.card-body -->
					<div class="card-footer">
						<div class="row">
							<div class="col-sm-6">
								<div class="row">

									<div class="form-group">
										<div class="form-check">
											<input class="form-check-input tableCheckAll" id="checkall" type="checkbox" >
											<label class="form-check-label" for="checkall">全选</label>
										</div>
									</div>
									<div class="form-group col-lg-3">
										<select class="form-control" name="action">
											<option value="">请选择...</option>
											<option value="doDelByIds" open-type="del-confirm">
												批量删除
											</option>
										</select>
									</div>

									<div class="form-group col-lg-3">
										<button type="button" class="btn btn-outline-primary batchExec">批量操作</button>
									</div>
								</div>
							</div>

							<div class="col-sm-6">
								#@_paginate()
							</div>
						</div>
					</div>
					<!-- /.card-footer -->
				</div>
				<!-- /.card -->
			</div>
	</section>
#end
